<%@ page import="cn.school.entity.Student,java.util.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/11 0011
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>EL测试</h1>
<%
    pageContext.setAttribute("msg","data in page");
    request.setAttribute("msg","data in request");
    session.setAttribute("msg","data in session");
    application.setAttribute("msg","data in application");
    Student stu=new Student();
    stu.setAddress("合肥庐阳区");
    stu.setStuno(199999L);
    stu.setSname("广涛.黄");

    request.setAttribute("student",stu);

    List list=new ArrayList();
    list.add("dog");
    list.add("cat");
    list.add("cow");
    list.add("pig");
    list.add("cock");
    request.setAttribute("animals",list);
    Map<String,String> m=new HashMap<>();
    m.put("dog","狗");
    m.put("snake","蛇");
    m.put("gun","枪");
    m.put("car","轿车");
    request.setAttribute("m",m);
%>
<h1 style="font-size: 77px;color:red;">
    ${msg}==${obj}==
</h1>

<h1>
msg in session:${sessionScope.msg}
</h1>
<h1>
    <!--访问student.getSname()方法-->
    学生信息:${student.sname},学号:${requestScope.student['stuno']}
</h1>
<h1>
    动物:${animals[1]},${animals[0]}
</h1>
<h1>词典:${m.dog},${m[car]},${m['snake']}</h1>
</body>
</html>
